/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package etherblocks.mods.survival.gui;

import etherblocks.engine.gui.*;
import etherblocks.engine.network.NetworkClient;
import etherblocks.mods.survival.messages.*;

/**
 *
 * @author Carl
 */
public class ScreenController_IngameMenu extends GameScreenController{

    public ScreenController_IngameMenu(){
        
    }
    private NetworkClient networkClient;
    private float barWidthFactor = 150;
    
    public void setHunger(float value, float percent){
        getTextRenderer("hunger").setText("" + (int)value);
        getElementByID("hungerBar").setWidth((int)(percent * barWidthFactor));
    }
    
    public void eat(){
        networkClient.sendMessage(new Message_EatCommand());
    }
    public void setHealth(float value, float percent){
        getTextRenderer("health").setText("" + (int)value);
        getElementByID("healthBar").setWidth((int)(percent * barWidthFactor));
    }
    
    public void heal(){
        networkClient.sendMessage(new Message_HealCommand());
    }

    public void setNetworkClient(NetworkClient networkClient){
        this.networkClient = networkClient;
    }
}
